<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person (name,age){
            this.name = name 
            this.age = age
            this.intro = function() {
                console.log('my name is' + this.name + ',I am' + this.age +'years old')
            }
        }
        var dary = new Person('Dary', 18)
        var aa = new Person ('NIE',20)
        dary.intro()
        aa.intro()
        //这样的话我们可以使用一个构造函数new多个实例
        
    </script>
</body>
</html>